package com.zretc.support.dao;

import com.zretc.support.entity.Exam;
import com.zretc.support.entity.Exampaper;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.io.Serializable;
import java.util.List;

public interface ExampaperDao extends JpaRepository<Exampaper,Integer>, JpaSpecificationExecutor<Exampaper>,
        CrudRepository<Exampaper,Integer>, Serializable {

    @Query("select e from Exampaper e where e.course.courseId in (?1)")
    Page<Exampaper> getExampaperByPage(List<Long> courseId, Pageable pageable);

    Exampaper getByPaperId(long paperId);
}

